package lambdasinaction.chap4;

import java.util.Arrays;
import java.util.List;

/**
 * TODO
 *
 * @author Fish
 * @since 0.0.1 2018/7/23 23:31
 */
public class MyDish {

  private final String name;
  private final boolean vegetarian;
  private final int calories;
  private final MyType type;

  public MyDish(String name, boolean vegetarian, int calories,
      MyType type) {
    this.name = name;
    this.vegetarian = vegetarian;
    this.calories = calories;
    this.type = type;
  }

  public String getName() {
    return name;
  }

  public boolean isVegetarian() {
    return vegetarian;
  }

  public int getCalories() {
    return calories;
  }

  public MyType getType() {
    return type;
  }

  public enum MyType {
    MEAT,
    FISH,
    OTHER
  }

  @Override
  public String toString() {
    return "MyDish{" +
        "name='" + name + '\'' +
        ", vegetarian=" + vegetarian +
        ", calories=" + calories +
        ", type=" + type +
        '}';
  }

  public static final List<MyDish> menu =
      Arrays.asList(new MyDish("pork", false, 800, MyType.MEAT),
          new MyDish("beef", false, 700, MyType.MEAT),
          new MyDish("chicken", false, 400, MyType.MEAT),
          new MyDish("french fries", true, 530, MyType.OTHER),
          new MyDish("rice", true, 350, MyType.OTHER),
          new MyDish("season fruit", true, 120, MyType.OTHER),
          new MyDish("pizza", true, 550, MyType.OTHER),
          new MyDish("prawns", false, 400, MyType.FISH),
          new MyDish("salmon", false, 450, MyType.FISH));
}
